package com.academysmart.bookagolf.model;

import infostroy.bookagolf.common.helpers.DateTimeHelper;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class GameBatch {

    private static final SimpleDateFormat format = new SimpleDateFormat(DateTimeHelper.DATE_TYPE_REST_WITH_TZ);

    private int id;

    private int players;

    private double price;

    private String startAt;

    private String endAt;

    private String interval;

    private boolean mon;

    private boolean tue;

    private boolean wed;

    private boolean thu;

    private boolean fri;

    private boolean sat;

    private boolean sun;

    private int holes;

    private Date date;

    private int golfFieldId;

    private String additionalPrices;

    private String currency;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getPlayers() {
        return players;
    }

    public void setPlayers(int players) {
        this.players = players;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getStartAt() {
        return startAt;
    }

    public void setStartAt(String startAt) {
        this.startAt = startAt;
    }

    public String getEndAt() {
        return endAt;
    }

    public void setEndAt(String endAt) {
        this.endAt = endAt;
    }

    public String getInterval() {
        return interval;
    }

    public void setInterval(String interval) {
        this.interval = interval;
    }

    public boolean isMon() {
        return mon;
    }

    public void setMon(boolean mon) {
        this.mon = mon;
    }

    public boolean isTue() {
        return tue;
    }

    public void setTue(boolean tue) {
        this.tue = tue;
    }

    public boolean isWed() {
        return wed;
    }

    public void setWed(boolean wed) {
        this.wed = wed;
    }

    public boolean isThu() {
        return thu;
    }

    public void setThu(boolean thu) {
        this.thu = thu;
    }

    public boolean isFri() {
        return fri;
    }

    public void setFri(boolean fri) {
        this.fri = fri;
    }

    public boolean isSat() {
        return sat;
    }

    public void setSat(boolean sat) {
        this.sat = sat;
    }

    public boolean isSun() {
        return sun;
    }

    public void setSun(boolean sun) {
        this.sun = sun;
    }

    public int getHoles() {
        return holes;
    }

    public void setHoles(int holes) {
        this.holes = holes;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public int getGolfFieldId() {
        return golfFieldId;
    }

    public void setGolfFieldId(int golfFieldId) {
        this.golfFieldId = golfFieldId;
    }

    public String getAdditionalPrices() {
        return additionalPrices;
    }

    public void setAdditionalPrices(String additionalPrices) {
        this.additionalPrices = additionalPrices;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public Date getStartAtAsDate() {
        try {
            return format.parse(getStartAt());
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }

    public Date getEndAtAsDate() {
        try {
            return  format.parse(getEndAt());
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }
}
